package com.g1.service.impl;

import com.g1.entity.Teacher;
import com.g1.mapper.TeacherMapper;
import com.g1.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImpl implements TeacherService {

    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    public List<Teacher> selectAll() {
        return teacherMapper.selectList(null);
    }

    @Override
    public Teacher selectById(Long id) {
        return teacherMapper.selectById(id);
    }

    @Override
    public int update(Teacher teacher) {
        return teacherMapper.updateById(teacher);
    }

    @Override
    public int delete(Long id) {
        return teacherMapper.deleteById(id);
    }

    @Override
    public int insert(Teacher teacher) {
        return teacherMapper.insert(teacher);
    }
}
